home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / readline.vim < prev    next >
Encoding:
Text File  |  2001-09-03  |  7.3 KB  |  149 lines

  1. " Maintainer    : Nikolai 'pcp' Weibull <da.box@home.se>
  2. " URL        : http://www.pcppopper.org/
  3. " Revised on    : Sun, 02 Sep 2001 17:11:08 +0200
  4. " Language    : readline configuration file
  5. " Variables    :
  6. "   readline_has_bash - if defined add support for bash specific
  7. "            settings/functions
  8.  
  9. if version < 600
  10.     syntax clear
  11. elseif exists("b:current_syntax")
  12.     finish
  13. endif
  14.  
  15. " Set iskeyword since we need `-' (and potentially others) in keywords.
  16. " For version 5.x: Set it globally
  17. " For version 6.x: Set it locally
  18. if version >= 600
  19.     command -nargs=1 SetIsk setlocal iskeyword=<args>
  20. else
  21.     command -nargs=1 SetIsk set iskeyword=<args>
  22. endif
  23. SetIsk 48-57,65-90,97-122,-
  24. delcommand SetIsk
  25.  
  26. " comments
  27. syn region  readlineComment    display oneline matchgroup=readlineComment start="^\s*#" end="$" contains=readlineTodo
  28.  
  29. " todo
  30. syn keyword readlineTodo    contained TODO FIXME
  31.  
  32. " strings (argh...not the way i want it, but fine..."
  33. syn match   readlineString    "^\s*[A-Za-z-]\+:"me=e-1 contains=readlineKeys
  34. syn region  readlineString    display oneline start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=readlineKeysTwo
  35.  
  36. " special key
  37. syn case ignore
  38. syn keyword readlineKeys    contained Control Meta Del Esc Escape LFD Newline Ret Return Rubout Space Spc Tab
  39. syn case match
  40.  
  41. syn match   readlineKeysTwo    contained +\\\([CM]-\|[e\\"'abdfnrtv]\|\o\{3}\|x\x\{3}\)+
  42.  
  43. " keymaps
  44. syn match   readlineKeymaps    contained "emacs\(-standard\|-meta\|-ctlx\)\="
  45. syn match   readlineKeymaps    contained "vi\(-move\|-command\|-insert\)\="
  46.  
  47. " bell styles
  48. syn keyword readlineBellStyles    contained audible visible none
  49.  
  50. " numbers
  51. syn match   readlineNumber    contained "\<\d\+\>"
  52.  
  53. " booleans
  54. syn case ignore
  55. syn keyword readlineBoolean    contained on off
  56. syn case match
  57.  
  58. " conditionals
  59. syn keyword readlineIfOps    contained mode term
  60.  
  61. syn region  readlineConditional display oneline transparent matchgroup=readlineConditional start="^\s*$if" end="$" contains=readlineIfOps,readlineKeymaps
  62. syn match   readlineConditional    "^\s*$\(else\|endif\)\>"
  63.  
  64. " include
  65. syn match   readlineInclude    "^\s*$include\>"
  66.  
  67. " settings
  68.  
  69. syn region  readlineSet        display oneline transparent matchgroup=readlineKeyword start="^\s*set\>" end="$"me=e-1 contains=readlineNumber,readlineBoolean,readlineKeymaps,readlineBellStyles,readlineSettings
  70.  
  71. syn keyword readlineSettings    contained bell-style comment-begin completion-ignore-case completion-ignore-case
  72. syn keyword readlineSettings    contained completion-query-items convert-meta disable-completion editing-mode enable-keypad 
  73. syn keyword readlineSettings    contained expand-tilde horizontal-scroll-mode mark-directories keymap mark-modified-lines meta-flag
  74. syn keyword readlineSettings    contained input-meta output-meta print-completions-horizontally show-all-if-ambiguous visible-stats
  75. syn keyword readlineSettings    contained prefer-visible-bell blink-matching-paren
  76.  
  77. " bash extensions
  78. if exists("readline_has_bash")
  79.     syn keyword readlineSettings    contained isearch-terminators
  80. endif
  81.  
  82. " key bindings
  83. syn region  readlineBinding    display oneline transparent matchgroup=readlineKeyword start=":" end="$" contains=readlineKeys,readlineFunctions
  84.  
  85. syn match   readlineFunctions    contained "\<\(beginning\|end\)-of-line\>"
  86. syn match   readlineFunctions    contained "\<\(backward\|forward\)-\(char\|word\)\>"
  87. syn match   readlineFunctions    contained "\<\(previous\|next\|\(beginning\|end\)-of\|\(non-incremental-\)\=\(reverse\|forward\)-search\)-history\>"
  88. syn match   readlineFunctions    contained "\<history-search-\(forward\|backward\)\>"
  89. syn match   readlineFunctions    contained "\<yank-\(nth\|last\)-arg\>"
  90. syn match   readlineFunctions    contained "\<\(backward-\)\=kill-\(\(whole-\)\=line\|word\)\>"
  91. syn match   readlineFunctions    contained "\<\(start\|end\|call-last\)-kbd-macro\>"
  92. syn match   readlineFunctions    contained "\<dump-\(functions\|variables\|macros\)\>"
  93. syn match   readlineFunctions    contained "\<non-incremental-\(reverse\|forward\)-search-history-again\>"
  94. syn keyword readlineFunctions    contained clear-screen redraw-current-line accept-line delete-char backward-delete-char quoted-insert tab-insert
  95. syn keyword readlineFunctions    contained self-insert transpose-chars transpose-words downcase-word capitalize-word unix-word-rubout
  96. syn keyword readlineFunctions    contained delete-horizontal-space kill-region copy-region-as-kill copy-backward-word copy-forward-word yank yank-pop
  97. syn keyword readlineFunctions    contained digit-argument universal-argument complete possible-completions insert-completions menu-complete
  98. syn keyword readlineFunctions    contained re-read-init-file abort do-uppercase-version prefix-meta undo revert-line tilde-expand set-mark
  99. syn keyword readlineFunctions    contained exchange-point-and-mark character-search character-search-backward insert-comment emacs-editing-mode vi-editing-mode
  100. syn keyword readlineFunctions    contained unix-line-discard upcase-word backward-delete-word vi-eof-maybe vi-movement-mode vi-match vi-tilde-expand
  101. syn keyword readlineFunctions    contained vi-complete vi-char-search vi-redo vi-search vi-arg-digit vi-append-eol vi-prev-word vi-change-to vi-delete-to
  102. syn keyword readlineFunctions    contained vi-end-word vi-fetch-history vi-insert-beg vi-search-again vi-put vi-replace vi-subst vi-yank-to vi-first-print
  103. syn keyword readlineFunctions    contained vi-yank-arg vi-goto-mark vi-append-mode vi-insertion-mode prev-history vi-set-mark vi-search-again vi-put vi-change-char
  104. syn keyword readlineFunctions    contained vi-subst vi-delete vi-yank-to vi-column vi-change-case vi-overstrike vi-overstrike-delete
  105. syn keyword readlineFunctions    contained do-lowercase-version delete-char-or-list tty-status arrow-key-prefix
  106.  
  107. " bash extensions
  108. if exists("readline_has_bash")
  109.     syn keyword readlineFunctions    contained shell-expand-line history-expand-line magic-space alias-expand-line history-and-alias-expand-line insert-last-argument
  110.     syn keyword readlineFunctions    contained operate-and-get-next forward-backward-delete-char delete-char-or-list complete-filename possible-filename-completions
  111.     syn keyword readlineFunctions    contained complete-username possible-username-completions complete-variable possible-variable-completions complete-hostname
  112.     syn keyword readlineFunctions    contained possible-hostname-completions complete-command possible-command-completions dynamic-complete-history complete-into-braces
  113.     syn keyword readlineFunctions    contained glob-expand-word glob-list-expansions display-shell-version
  114. endif
  115.  
  116. " Define the default highlighting.
  117. " For version 5.7 and earlier: only when not done already
  118. " For version 5.8 and later: only when an item doesn't have highlighting yet
  119. if version >= 508 || !exists("did_readline_syn_inits")
  120.     if version < 508
  121.     let did_readline_syn_inits = 1
  122.     command -nargs=+ HiLink hi link <args>
  123.     else
  124.     command -nargs=+ HiLink hi def link <args>
  125.     endif
  126.  
  127.     HiLink readlineComment    Comment
  128.     HiLink readlineTodo        Todo
  129.     HiLink readlineString    String
  130.     HiLink readlineKeys        SpecialChar
  131.     HiLink readlineKeysTwo    SpecialChar
  132.     HiLink readlineKeymaps    Constant
  133.     HiLink readlineBellStyles    Constant
  134.     HiLink readlineNumber    Number
  135.     HiLink readlineBoolean    Boolean
  136.     HiLink readlineIfOps    Type
  137.     HiLink readlineConditional    Conditional
  138.     HiLink readlineInclude    Include
  139.     HiLink readlineKeyword    Keyword
  140.     HiLink readlineSettings    Type
  141.     HiLink readlineFunctions    Type
  142.     delcommand HiLink
  143. endif
  144.  
  145. let b:current_syntax = "readline"
  146.  
  147. " vim: set sw=4 sts=4:
  148.  
  149.